/**  
 * All rights Reserved, Designed By <a href="www.itttq.com" target="_blank">www.itttq.com</a>
 * @date:   2018年1月3日 下午2:29:11
 * @Copyright: 2018 <a href="www.itttq.com" target="_blank">www.itttq.com</a> Inc. All rights reserved. 
 */  
package com.itttq.gshop.pbpm.cmpt.mybatis;

import org.apache.ibatis.jdbc.SQL;

/**   
 * 自定义分页
 * @ClassName:  CustomerSQL
 * @author: 迷蝶
 * @date:   2018年1月3日 下午2:29:11 
 *     
 * @Copyright: 2018 <a href="www.itttq.com" target="_blank">www.itttq.com</a> Inc. All rights reserved. 
 */
public class CustomerSQL extends SQL {
	private String limitSql = "";
	@Override
	public CustomerSQL getSelf() {
	    return this;
	}
	/**
	 * 分页的简单实现
	 * 
	 * @param start
	 * @param limit
	 * @return
	 * @Author 迷蝶
	 * @return CustomerSQL
	 */
	public CustomerSQL LIMIT(int start, int limit) {
		limitSql = " limit " + start + "," + limit;
	    return getSelf();
	}
	
	@Override
	public String toString() {
	    return super.toString() + limitSql;
	}
}
